

let cubeManage = echarts.init(document.getElementById('cubeManage'))
cubeManage.setOption({
  title: {
    text: '线索管理',
    textStyle: {
      color: 'rgba(0, 0, 0, 0.54)',
      fontSize: 18,
      fontFamily: 'Microsoft YaHei',
      fontWeight: 600
    }
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: [{
      name: '新增',
      icon: 'circle',
    }, {
      name: '流失',
      icon: 'circle',
    }, {
      name: '抢单',
      icon: 'circle',
    }],
    right: '10%'
  },
  calculable: true,
  xAxis: [
    {
      type: 'category',
      data: ['新车', '保养', '做漆', '保险'],
      axisLine: {
        show: false
      }
    }
  ],
  yAxis: [
    {
      type: 'value',
      interval: 25,
      axisLine: {
        show: false
      },
      splitLine: {
        lineStyle: {
          type: 'dotted'
        }
      }
    }
  ],
  series: [
    {
      name: '新增',
      type: 'bar',
      data: [34, 23, 31, 26],
      barGap: '100%',
      itemStyle: {
        normal: {
          color: '#73c149'
        }
      }
    },
    {
      name: '流失',
      type: 'bar',
      data: [34, 55, 65, 89],
      itemStyle: {
        normal: {
          color: '#4c98fc'
        }
      }
    },
    {
      name: '抢单',
      type: 'bar',
      data: [32, 45, 65, 87],
      itemStyle: {
        normal: {
          color: '#f59342'
        }
      }
    }
  ]
})

let taskManage = echarts.init(document.getElementById('taskManage'))
taskManage.setOption({
  title: {
    text: '任务管理',
    textStyle: {
      color: 'rgba(0, 0, 0, 0.54)',
      fontSize: 18,
      fontFamily: 'Microsoft YaHei',
      fontWeight: 600
    }
  },
  tooltip: {
    trigger: 'axis'
  },
  calculable: true,
  xAxis: [
    {
      type: 'category',
      data: ['新车', '保养', '做漆', '保险'],
      axisLine: {
        show: false
      }
    }
  ],
  yAxis: [
    {
      type: 'value',
      interval: 25,
      axisLine: {
        show: false
      },
      splitLine: {
        lineStyle: {
          type: 'dotted'
        }
      }
    }
  ],
  series: [
    {
      type: 'line',
      data: [20, 70, 60, 90],
      smooth: true,
      itemStyle: {
        normal: {
          color: '#9ad2f9'
        }
      }

    },
    {
      type: 'bar',
      data: [20, 70, 60, 90],
      barWidth: '30%',
      itemStyle: {
        normal: {
          color: new echarts.graphic.LinearGradient(
            0, 0, 0, 1,
            [
              {offset: 0, color: '#fdfeff'},
              {offset: 0.5, color: '#f7fcff'},
              {offset: 1, color: '#9ad2f9'}
            ]
          )
        },
        emphasis: {
          color: new echarts.graphic.LinearGradient(
            0, 0, 0, 1,
            [
              {offset: 0, color: '#9ad2f9'},
              {offset: 0.7, color: '#f7fcff'},
              {offset: 1, color: '#fdfeff'}
            ]
          )
        }
      }
    }
  ]
})

for (let i = 1; i < 4; i++) {
  let quoteManage = echarts.init(document.getElementById('pie' + i))
  quoteManage.setOption({
    series: [
      {
        type: 'pie',
        radius: ['50%', '70%'],
        avoidLabelOverlap: false,
        label: {
          normal: {
            show: true,
            position: 'center',
            formatter: "{d}%"
          }
        },
        hoverAnimation: false,
        labelLine: {
          normal: {
            show: true
          }
        },
        data: [
          {
            value: 278, name: '新车报价覆盖率', itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                offset: 0, color: '#eba180'
              }, {
                offset: 0.5, color: '#f174b0'
              },
                {
                  offset: 1, color: '#eba180'
                }], false)
            }
          },
          },
          {
            value: 110, name: '', itemStyle: {
            normal: {
              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                offset: 0, color: '#feeef0'
              },
                {
                  offset: 1, color: '#feeef0'
                }], false)
            }
          },
          },
        ],
        color: ['#f175b0', '#feeef0']
      }
    ]
  })
}


